import 'dart:convert';

BooksDataSummaryResult booksDataSummaryResultFromJson(String str) =>
    BooksDataSummaryResult.fromJson(json.decode(str));

String booksDataSummaryResultToJson(BooksDataSummaryResult data) =>
    json.encode(data.toJson());

class BooksDataSummaryResult {
  BooksDataSummaryResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  Result? result;

  factory BooksDataSummaryResult.fromJson(Map<String, dynamic> json) =>
      BooksDataSummaryResult(
        status: json["status"],
        message: json["message"],
        result: Result.fromJson(json["result"]),
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class Result {
  Result({
    this.total,
    this.level,
    this.category,
  });

  int? total;
  Map<String, int>? level;
  Map<String, int>? category;

  factory Result.fromJson(Map<String, dynamic> json) => Result(
        total: json["total"],
        level:
            Map.from(json["level"]).map((k, v) => MapEntry<String, int>(k, v)),
        category: Map.from(json["category"])
            .map((k, v) => MapEntry<String, int>(k, v)),
      );

// 这里转json有错误，暂时跳过，上传数据不会用到
  Map<String, dynamic> toJson() => {
        "total": total,
        "level": null,
        "category": null,
        //         "level": Map.from(level).map((k, v) => MapEntry<String, int>(k, v)),
        // "category":
        //     Map<String, int>.from(category).map((k, v) => MapEntry<String, int>(k, v)),
      };
}
